import 'package:coinbaby/common/textstyle/textstyle.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

class RichProtocolView extends StatelessWidget {

  void _userProtocol(bool isuserprotocl) {
    print(isuserprotocl);
  }

  @override
  Widget build(BuildContext context) {
    return Text.rich(
      TextSpan(
        children: [
          TextSpan(text: "登录即表明同意"),
          TextSpan(
            text: "《币小贝用户协议》",
            style: AppFont.textStyle(14, Colors.blue),
            recognizer: TapGestureRecognizer()..onTap = () => _userProtocol(true),
          ),
          TextSpan(
            text: "和",
          ),
          TextSpan(
            text: "《隐私政策》",
            style: AppFont.textStyle(14, Colors.blue),
            recognizer: TapGestureRecognizer()..onTap = () => _userProtocol(false),
          )
        ]
      )
    );
  }
}